package nuc.jyg.dto;

import nuc.jyg.entity.Appointment;
import nuc.jyg.util.AppointmentStateEnum;

/**
 * @Author Nuc YongGuang Ji
 * Created by JiYongGuang on 2017/5/30.
 */
public class AppointExecution {

    // 图书ID
    private long bookId;

    // 预约状态码
    private int state;

    // 状态码详细描述
    private String stateInfo;

    // 预约成功对象
    private Appointment appointment;

    public AppointExecution() {
    }

    // 预约失败的构造器
    public AppointExecution(long bookId, AppointmentStateEnum stateEnum) {
        this.bookId = bookId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    // 预约成功的构造器
    public AppointExecution(long bookId, AppointmentStateEnum stateEnum, Appointment appointment) {
        this.bookId = bookId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.appointment = appointment;
    }

    /**
     * Getter for property 'bookId'.
     *
     * @return Value for property 'bookId'.
     */
    public long getBookId() {
        return bookId;
    }

    /**
     * Setter for property 'bookId'.
     *
     * @param bookId Value to set for property 'bookId'.
     */
    public void setBookId(long bookId) {
        this.bookId = bookId;
    }

    /**
     * Getter for property 'state'.
     *
     * @return Value for property 'state'.
     */
    public int getState() {
        return state;
    }

    /**
     * Setter for property 'state'.
     *
     * @param state Value to set for property 'state'.
     */
    public void setState(int state) {
        this.state = state;
    }

    /**
     * Getter for property 'stateInfo'.
     *
     * @return Value for property 'stateInfo'.
     */
    public String getStateInfo() {
        return stateInfo;
    }

    /**
     * Setter for property 'stateInfo'.
     *
     * @param stateInfo Value to set for property 'stateInfo'.
     */
    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    /**
     * Getter for property 'appointment'.
     *
     * @return Value for property 'appointment'.
     */
    public Appointment getAppointment() {
        return appointment;
    }

    /**
     * Setter for property 'appointment'.
     *
     * @param appointment Value to set for property 'appointment'.
     */
    public void setAppointment(Appointment appointment) {
        this.appointment = appointment;
    }

    @Override
    public String toString() {
        return "AppointExecution{" +
                "bookId=" + bookId +
                ", state=" + state +
                ", stateInfo='" + stateInfo + '\'' +
                ", appointment=" + appointment +
                '}';
    }

}
